package com.whalefall.eureka;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

import lombok.extern.slf4j.Slf4j;

/**
 * 
 * @author fish
 *	服务中心
 */
@Slf4j
@EnableEurekaServer
@SpringBootApplication
public class WhaleFallEurekaApplication {
	
	public static void main(String[] args) {
		SpringApplication.run(WhaleFallEurekaApplication.class, args);
		log.info("(づ￣ 3￣)づ");
	}
	
	@Configuration
	public static class SecurityPermitAllConfig extends WebSecurityConfigurerAdapter{
		
		@Override
		protected void configure(HttpSecurity http) throws Exception {
			// Spring Could 2.0 eureka 配置spring.security后其他服务无法连接注册中心
			http.csrf().disable();
			super.configure(http);
		}
	}
}
